/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: Controller.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/17 下午7:05
 * LastModified: 2020/03/17 19:05:17
 */

package com.qolome.knowledge.design.pattern.command.gplayer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Qolome
 * @version V1.0
 * @Description 控制器
 * @date 2020年 03月17日 19:05:40
 */
public class Controller {

    private List<IAction> actionList = new ArrayList<>();

    public void addAction(IAction action){
        actionList.add(action);

    }

    public void execute(IAction action){
        action.execute();
    }

    public void executes(){
        for (IAction action:actionList) {
            action.execute();
        }
        actionList.clear();
    }





}
